/*
 * @Author: ayun chengyunwu@jiatui.com
 * @Date: 2022-12-01 15:06:11
 * @LastEditors: ayun chengyunwu@jiatui.com
 * @LastEditTime: 2023-07-10 10:36:35
 * @FilePath: /gov-baoan-h5/src/store/User/index.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { UPDATE } from "./action-type";

export type InitStateInfo = {
  data: {
    lastJointTime?: string;
    leaderName?: string;
    planInvestVolume?: any;
    companyName?: string;
    settledAppeal?: string;
    team?: string;
    turnDept?: string;
    projectName?: string
    labelNames?: any
  };
};

const initState: InitStateInfo = {
  data: {
    lastJointTime: "",
    leaderName: "",
    planInvestVolume: null,
    companyName: "",
    settledAppeal: '',
    team: '',
    turnDept: '',
    projectName: '',
    labelNames: null
  },
};

const store = (
  state = initState,
  { type, data }: { type: any; data: InitStateInfo["data"] }
) => {
  switch (type) {
    case UPDATE:
      state.data = data;
      return { ...state };
    default:
      return state;
  }
};

export default store;
